package com.zzx.filter.config;

import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.zzx.filter.MyFilter;

/**
 * 过滤器拦截器配置载入
 * @author Administrator
 *
 */
//@Configuration
public class WebConfig extends WebMvcConfigurerAdapter{
	  
	  @SuppressWarnings({ "rawtypes", "unchecked" })
	  @Bean
	  public FilterRegistrationBean filterRegist() {
	      FilterRegistrationBean frBean = new FilterRegistrationBean();
	      frBean.setFilter(new MyFilter());
	      frBean.addUrlPatterns("/**");
	      System.out.println("****aa ****filter");
	      return frBean;
	  }
}
